package foundation;

import org.apache.commons.io.FileUtils;
import org.json.JSONObject;

import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

/**
 * <h1></h1>
 *
 * @author zhh 2019-05-30
 */
public class ReadJson {
    public static void main(String[] args) throws IOException {
        File file = new File(ReadJson.class.getResource("/main/student.json").getFile());
        String content = FileUtils.readFileToString(file, StandardCharsets.UTF_8);
        JSONObject jsonObject = new JSONObject(content);
        System.out.println(jsonObject.getString("name"));
    }
}
